package com.apes.fn.scm.vipSettle.repository;

import com.apes.fn.scm.vipSettle.model.VipUnionSettleItem;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface VipUnionSettleItemRepository extends CustomRepository<VipUnionSettleItem,String> {

    @Query("SELECT COUNT(T) AS CZBJ FROM VipUnionSettleItem T  WHERE T.product.id = :productId AND T.retailOrder = :retailOrderId AND T.vipBalanceType = :vipBalanceType")
    int existsVipSettleItem(@Param("productId") String productId,@Param("retailOrderId") String retailOrderId,@Param("vipBalanceType") int vipBalanceType);
}
